package com.example.myapplication01.jetpack.room;

import android.app.Application;

import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;

import java.util.List;

public class UserViewModel extends AndroidViewModel {

    private final UserRepository repository;

    public UserViewModel(@NonNull Application application) {
        super(application);
        repository = new UserRepository(application);
    }

    public LiveData<List<User>> getLiveUserListData() {
        return repository.getLiveUserListData();
    }

    public void insert(User... users) {
        repository.insert(users);
    }

}
